package org.babygo.connect.protocol;

import java.io.File;

import com.alibaba.fastjson.JSONObject;


public class GetAndSendFileRequest {
	private String fileName;
	private File file = null;
	private String port = "0000";

	public GetAndSendFileRequest(){}
	
	public String getPort() {
		return port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	public GetAndSendFileRequest(String fileName) {
		this.fileName = fileName;
	}

	public GetAndSendFileRequest(String json, boolean isJson) {
		JSONObject jsonObject = JSONObject.parseObject(json);
		this.fileName = (String) jsonObject.get("fileName");
		this.port = (String) jsonObject.get("port");
	}
	
	public GetAndSendFileRequest(String fileName, File f) {
		this.fileName = fileName;
		this.file = f;
	}

	public GetAndSendFileRequest(String fileName, String port) {
		this.fileName = fileName;
		this.port = port;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}
	
}